package com.question.java.array;

import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * Author: Jun.Yang
 * Create: Jun.Yang (2015/10/19)
 * Description: 在指定(m, n)范围内产生随机数，最小值是m,最大值是n
 * To change this template use File | Settings | File Templates.
 */
public class CreateRangeRandom {
    public static int randInt(int min, int max) {
        Random rand = new Random();
        int randomNum = rand.nextInt((max - min) + 1) + min;
        return randomNum;
    }

    public static void main(String[] args) {
        for(int i = 0; i < 20; i++) {
            System.out.println(CreateRangeRandom.randInt(6, 10));
        }
    }
}
